import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager

#1、打开浏览器---驱动管理
ChromeIns = ChromeDriverManager().install()
#创建谷歌浏览器驱动对象
driver = webdriver.Chrome(service=Service(ChromeIns))
driver.get("https://www.baidu.com")

#设置窗口大小
#最大化
time.sleep(2)
driver.maximize_window()
#最小化
time.sleep(2)
driver.minimize_window()
#全屏
time.sleep(2)
driver.fullscreen_window()
#手动设置尺寸
time.sleep(2)
driver.set_window_size(1024,800)
time.sleep(2)

driver.quit()